package start;


import com.jfinal.core.JFinal;

public class Start {

	public static void main(String[] args) {
		/*String appDir = Start.class.getResource("/").getPath().replace("/WEB-INF/classes/", "");
		//appDir = Start.class.getResource("/").getPath();
		System.out.println(appDir);
		System.out.println(appDir.substring(1));
		JFinal.start(appDir.substring(1), 801, "/", 5);*/
		
		String webAppDir = Start.class.getResource("/").getPath()
				.replace("/WEB-INF/classes/", "");
		int port = 80;
		String content = "/";
		if (args != null && args.length > 0) {
			try {
				port = Integer.parseInt(args[0]);
				content = args[1];
			} catch (Exception e) {
			}
		}
		try {
			JFinal.start(webAppDir.substring(1), port, content, 5);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
